package com.youkeda.yunmusic.web.control;


import com.youkeda.yunmusic.web.modle.Comment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;


import java.util.List;

@Controller
public class CommentControl {

    @Autowired
    private CommentPostControl commentPostControl;

    @RequestMapping(path = "/comments")
    public String comments(ModelMap modelMap){

        List<Comment> comments = commentPostControl.getComments("35847388");
        modelMap.addAttribute("comments",comments);
        return "comments";
    }
}
